package com.jhclothing.product.mapper;

import com.jhclothing.product.domain.ClothingInventory;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 服饰库存Mapper接口
 *
 * @author zyp
 * @date 2024-04-24
 */
public interface ClothingInventoryMapper {
    /**
     * 查询服饰库存
     *
     * @param clothingInventoryId 服饰库存主键
     * @return 服饰库存
     */
    ClothingInventory selectClothingInventoryByClothingInventoryId(Long clothingInventoryId);

    /**
     * 查询服饰库存列表
     *
     * @param clothingInventory 服饰库存
     * @return 服饰库存集合
     */
    List<ClothingInventory> selectClothingInventoryList(ClothingInventory clothingInventory);

    /**
     * 统计使用的服饰类别
     *
     * @param clothingTypeId 服饰类别ID
     * @return
     */
    int countClothingTypeByClothingTypeId(Long clothingTypeId);

    /**
     * 查询服饰品类+服饰编码的产品是否唯一
     *
     * @param clothingTypeId 服饰品类ID
     * @param clothingSize   服饰编码
     * @return 服饰信息
     */
    ClothingInventory checkClothingTypeAndSizeUnique(@Param("clothingTypeId") Long clothingTypeId,
                                                            @Param("clothingSize") String clothingSize);

    /**
     * 新增服饰库存
     *
     * @param clothingInventory 服饰库存
     * @return 结果
     */
    int insertClothingInventory(ClothingInventory clothingInventory);

    /**
     * 修改服饰库存
     *
     * @param clothingInventory 服饰库存
     * @return 结果
     */
    int updateClothingInventory(ClothingInventory clothingInventory);

    /**
     * 更新服饰库存
     *
     * @param clothingInventoryId 服饰库存ID
     * @param nowInventory        服饰库存
     * @Param updateBy            更新者
     * @return 结果
     */
    int updateClothingInventoryInfo(@Param("clothingInventoryId") Long clothingInventoryId,
                                @Param("nowInventory")Integer nowInventory,
                                @Param("updateBy") String updateBy);

    /**
     * 删除服饰库存
     *
     * @param clothingInventoryId 服饰库存主键
     * @return 结果
     */
    int deleteClothingInventoryByClothingInventoryId(Long clothingInventoryId);

    /**
     * 批量删除服饰库存
     *
     * @param clothingInventoryIds 需要删除的数据主键集合
     * @return 结果
     */
    int deleteClothingInventoryByClothingInventoryIds(Long[] clothingInventoryIds);
}
